package no.group.gowther.rest.vo;

import no.group.gowther.enums.FileType;
import no.group.gowther.service.dto.FileDTO;
import no.group.gowther.service.dto.ImageCode;


public class FileVO {
    private final String filePath;
    private final FileType type;
    private final String iconCode;
    private final boolean containsImage;
    private final Boolean empty;

    public FileVO(FileDTO fileDTO) {
        this.filePath = fileDTO.getFile().toString();
        this.type = fileDTO.getType();
        this.iconCode = fileDTO.getImageCode() != null ? fileDTO.getImageCode().getUrlEncodeImageCode() : "";
        this.containsImage = fileDTO.isContainsImage();
        this.empty = fileDTO.isEmpty();
    }

    public String getFilePath() {
        return filePath;
    }

    public FileType getType() {
        return type;
    }

    public String getIconCode() {
        return iconCode;
    }

    public Boolean getEmpty() {
        return empty;
    }

    public boolean isContainsImage() {
        return containsImage;
    }
}
